package com.example.mvp.mvp.view;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.example.mvp.mvp.presenter.IPresenter;

import javax.inject.Inject;

public abstract class BaseFragment<P extends IPresenter> extends Fragment implements IFragment,IView {

    protected View myview;
    @Inject
    protected P mypre;
    @Override
    public <T extends View> T findViewById(int id) {
        return myview.findViewById(id);
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        myview = inflater.inflate(findlayout(),container,false);

        return myview;

    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        initView();
        initData();
    }


}
